package org.layuiframework.stereotype.exception;

import lombok.Getter;
import org.layuiframework.stereotype.vo.AppCode;
import org.layuiframework.stereotype.vo.ResultCode;

@Getter
public class APIException extends RuntimeException {

    private int code;
    private String msg;

    public APIException(ResultCode responsePackError, String message) {
        super(message);
        this.code = responsePackError.getCode();
        this.msg = responsePackError.getMsg();
    }

    public APIException(String message) {
        super(message);
        this.code = AppCode.APP_ERROR.getCode();
        this.msg = AppCode.APP_ERROR.getMsg();
    }

}
